package com.dili.dd.gpi.mapper;

import com.dili.dd.gpi.domain.Platform;
import com.dili.dd.gpi.domain.PlatformExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.Update;

public interface PlatformMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table platform
     *
     * @mbggenerated Wed Oct 14 14:27:53 CST 2015
     */
    int countByExample(PlatformExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table platform
     *
     * @mbggenerated Wed Oct 14 14:27:53 CST 2015
     */
    int deleteByExample(PlatformExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table platform
     *
     * @mbggenerated Wed Oct 14 14:27:53 CST 2015
     */
    @Delete({
        "delete from platform",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table platform
     *
     * @mbggenerated Wed Oct 14 14:27:53 CST 2015
     */
    @Insert({
        "insert into platform (`name`, item_code)",
        "values (#{name,jdbcType=VARCHAR}, #{itemCode,jdbcType=VARCHAR})"
    })
    @SelectKey(statement="SELECT LAST_INSERT_ID()", keyProperty="id", before=false, resultType=Integer.class)
    int insert(Platform record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table platform
     *
     * @mbggenerated Wed Oct 14 14:27:53 CST 2015
     */
    int insertSelective(Platform record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table platform
     *
     * @mbggenerated Wed Oct 14 14:27:53 CST 2015
     */
    List<Platform> selectByExample(PlatformExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table platform
     *
     * @mbggenerated Wed Oct 14 14:27:53 CST 2015
     */
    @Select({
        "select",
        "id, `name`, item_code",
        "from platform",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("BaseResultMap")
    Platform selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table platform
     *
     * @mbggenerated Wed Oct 14 14:27:53 CST 2015
     */
    int updateByExampleSelective(@Param("record") Platform record, @Param("example") PlatformExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table platform
     *
     * @mbggenerated Wed Oct 14 14:27:53 CST 2015
     */
    int updateByExample(@Param("record") Platform record, @Param("example") PlatformExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table platform
     *
     * @mbggenerated Wed Oct 14 14:27:53 CST 2015
     */
    int updateByPrimaryKeySelective(Platform record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table platform
     *
     * @mbggenerated Wed Oct 14 14:27:53 CST 2015
     */
    @Update({
        "update platform",
        "set `name` = #{name,jdbcType=VARCHAR},",
          "item_code = #{itemCode,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Platform record);
}